'''
@Project ：my_python_project 
@File    ：temp.py
@IDE     ：PyCharm 
@Author  ：xionglinhui
@Date    ：2024/7/10 上午9:00 
'''
#文件对象又称为文件句柄


# with open('/home/xionglinhui/my_python_project/tests/day11/a.txt', mode='rt') as f1: # f1=open('a.txt',mode='rt')
#     res=f1.read()
#     print(res)

with open('test1/c', mode='rt') as f1: # f1=open('a.txt',mode='rt')
    res=f1.read()
    print(res)


with open('test1/a.txt', mode='rt') as f1,\
        open('test1/b', mode='rt') as f2,\
        open('test1/c', mode='rt') as f3:
    res1=f1.read()
    res2=f2.read()
    print(res1)
    print(res2)

    f1.close()  # with 语法已经将f1/f2关闭，这两步可以省略
    f2.close()
